const fs = require('fs');

exports.readApiJson = function readApiJson(callback) {
  let fileName = '/api.json';
  fs.readFile(__dirname + fileName, 'utf-8', function (err, data) {
      if (err) {
          return console.error(err);
      }

      let json = JSON.parse(data)

      let result = []
      for (let path in json) {
        result.push({
          path,
          fileName: json[path]
        })
      }

      callback(result)
  });
}
